//************************************************************************
// author	:	vera												
// date		:	2011/4/5 23:17 					                 
//************************************************************************
#ifndef SL_BOUNDINGBOX_H_
#define SL_BOUNDINGBOX_H_
#include "Config.h"
#include "Referenced.h"
#include "Vector3.h"
namespace sl
{
	class SL_EXPORT BoundingBox : public Referenced
	{
		enum Extent
		{
			EXTENT_NULL,
			EXTENT_FINITE,
			EXTENT_INFINITE
		};
	public:
		BoundingBox(void);
		~BoundingBox(void);

		void		Add( sl::Vector3 & vec );

		bool		IsNull() { return m_eExtent == EXTENT_NULL; }

		bool		IsInifinite() { return m_eExtent == EXTENT_INFINITE; }

		Vector3		GetCenter() { return (m_vMin + m_vMax) * 0.5; }

		// can calculate the legth width heigh
		Vector3 	GetSize() { return (m_vMax - m_vMin) * 0.5; }

	private:
		Vector3		m_vMin;
		Vector3		m_vMax;
		Extent		m_eExtent;
	};

}

#endif
